<template>
  <view class="draw-code">
    <canvas canvas-id="table-code" class="code-img" />
  </view>
</template>

<script>
import DrawCode from "./drawCode";
let drawCode;
export default {
  name: "DrawCode",
  props: {
    data: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  data() {
    return {};
  },
  mounted() {},
  methods: {
    draw() {
      drawCode = new DrawCode("table-code");
      drawCode.draw(this.data);
    }
  }
};
</script>

<style lang="scss" scoped>
.draw-code {
  height: 100vh;
  .code-img {
    height: 100%;
    width: 100%;
  }
}
</style>